﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DAO
{
    /// <summary>
    /// Summary description for Title
    /// </summary>
    public class Title
    {
        public String[] Titles;
        public String[] DatePosted;
        String UserID;
        public String[] ID;
        public Title()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public Title(String _ID)
        {
            UserID = _ID;
            DAO.Entry a = new DAO.Entry();
            List<String> T = new List<String>();
            List<String> D = new List<String>();
            List<String> BV = new List<String>();
            int n = a.GetAllTitle(_ID, T, D, BV);
            Titles = new String[n];
            DatePosted = new String[n];
            ID = new String[n];
            int i = 0;
            foreach (String b in T)
            {
                Titles[i] = b;
                i++;
            }
            i = 0;
            foreach (String c in D)
            {
                DatePosted[i] = c;
                i++;
            }
            i = 0;
            foreach (String idbv in BV)
            {
                ID[i] = idbv;
                i++;
            }
        }
        public void Reset()
        {
            if (UserID != null)
            {
                DAO.Entry a = new DAO.Entry();
                List<String> T = new List<String>();
                List<String> D = new List<String>();
                List<String> BV = new List<String>();
                int n = a.GetAllTitle(UserID, T, D, BV);
                Titles = new String[n];
                DatePosted = new String[n];
                ID = new String[n];
                int i = 0;
                foreach (String b in T)
                {
                    Titles[i] = b;
                    i++;
                }
                i = 0;
                foreach (String c in D)
                {
                    DatePosted[i] = c;
                    i++;
                }
                i = 0;
                foreach (String idbv in BV)
                {
                    ID[i] = idbv;
                    i++;
                }
            }
        }
    }
}